import 'package:fluwx/fluwx.dart';

import '../model/share_model.dart';

class WxUtil {
  static Future<bool> checkWxInstall() async {
    Fluwx fluwx = Fluwx();
    var result = await fluwx.isWeChatInstalled;
    return result;
  }

  static wxShareSessionWebPage(InviteShareModel model) {
    Fluwx().share(WeChatShareWebPageModel(model.url ?? '',
        scene: WeChatScene.session,
        title: model.title ?? '',
        thumbnail: WeChatImage.network(model.imageUrl ?? ''),
        description: model.content));
  }

  static wxShareTimelineWebPage(InviteShareModel model) {
    Fluwx().share(WeChatShareWebPageModel(model.url ?? '',
        scene: WeChatScene.timeline,
        title: model.title ?? '',
        thumbnail: WeChatImage.network(model.imageUrl ?? ''),
        description: model.content));
  }
}
